package com.china08.yxyapi.schedule.statistics;

import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.china08.yxyapi.util.DateUtils;
import com.china08.yxyapi.util.SwsStatisticsUtil;
import com.china08.yxyapi.util.YxyScheduleRunnableUtil;

@Component
public class SwsWebsiteStatisticsTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(SwsWebsiteStatisticsTask.class);

    /**
     * (学校)网站统计所需数据
     */
    // @Scheduled(cron = "0 0 2 * * ?")
    // @Scheduled(cron = "0 */3 * * * ?")
    public void swsTask() {
        // ##
        // 检测定时任务是否可执行
        if (!YxyScheduleRunnableUtil.checkRunnable()) { return; }

        SwsStatisticsUtil.swsForDayStatis(DateUtils.formatDate4(new Date()));
    }
}
